#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "QTcpServer"
#include "QTcpSocket"
#include "QNetworkInterface"
#include "QFileDialog"
#include "QMessageBox"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void showLocalIPAddr();
    QString packageFileInfoData();
    void connectSocket();
    void downloadItemSendToClient();
    void sendFile(QFile &file);

private slots:
    void on_pushButtonOpenServer_clicked();

    void on_pushButtonChooseDir_clicked();

    void dealMsgFromClient();

private:
    Ui::MainWindow *ui;
    QString dirPath;
    QTcpServer *server;
    QTcpSocket *socket;
};
#endif // MAINWINDOW_H
